package com.example.JavaWebApi.service.impl.neo4j;

import com.example.JavaWebApi.mapper.neo4j.PersonRepository;
import com.example.JavaWebApi.model.neo4j.node.Person;
import com.example.JavaWebApi.service.neo4j.IPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: java-web-api
 * @description:
 * @author: 杨泽
 * @create: 2023-09-13 13:46
 */
@Service
public class PersonServiceImpl implements IPersonService {
    @Autowired
    private PersonRepository personRepository;
    @Override
    public Boolean add(Person person) {
        personRepository.save(person);
        return true;
    }

    @Override
    public List<Person> getAll() {
        //personRepository.deleteAll();
        return personRepository.findAll();
    }
}